package com.wenjiang.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class AuthSysUser implements Serializable {
    private Integer urId;

    private String urUserName;
    @JsonIgnore
    private String urPassword;
    @JsonIgnore
    private Integer urSalt;

    private String introduction;

    private String avatar;

    private String name;

    private List<AuthSysRole> roleList;

    private List<Integer> roles;

    private static final long serialVersionUID = 1L;

    public List<AuthSysRole> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<AuthSysRole> roleList) {
        this.roleList = roleList;
    }

    public List<Integer> getRoles() {
        if(this.roleList != null){
            this.roles = new ArrayList<>();
            for(AuthSysRole role:roleList){
                this.roles.add(role.getRlId());
            }
        }
        return roles;
    }

    public void setRoles(List<Integer> roles) {
        this.roles = roles;
    }

    public Integer getUrId() {
        return urId;
    }

    public void setUrId(Integer urId) {
        this.urId = urId;
    }

    public String getUrUserName() {
        return urUserName;
    }

    public void setUrUserName(String urUserName) {
        this.urUserName = urUserName == null ? null : urUserName.trim();
    }

    public String getUrPassword() {
        return urPassword;
    }

    public void setUrPassword(String urPassword) {
        this.urPassword = urPassword == null ? null : urPassword.trim();
    }

    public Integer getUrSalt() {
        return urSalt;
    }

    public void setUrSalt(Integer urSalt) {
        this.urSalt = urSalt;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction == null ? null : introduction.trim();
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar == null ? null : avatar.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }
}